package beans;

import java.io.Serializable;
import java.util.ArrayList;


public class IngredientContainer implements Serializable {
	private ArrayList ingredients;
	
	/**
	 * Constructor
	 * @param
	 * */
	public IngredientContainer() {
		ingredients = new ArrayList();
	}
	
	/**
	 * Constructor
	 * @param ingredients@param
	 * */
	public IngredientContainer(ArrayList ingredients) {
		this.ingredients = ingredients;
	}	

	/**
	 * @param ingredient
	 */
	public void addToContainer(Ingredient ingredient) {
		ingredients.add(ingredient);
	}
	
	/**
	 * @return
	 */
	public ArrayList getIngredients() {
		return ingredients;
	}

	/**
	 * Eli bean voidaan poistaa indexin mukaan
	 * @param index is a index of ingredient bean on arraylist
	 */
	public void removeFromContainer(int index) {
		ingredients.remove(index);
	}

	/**
	 * @param ingredient
	
	public void removeFromContainer(Ingredient ingredient) {
		ingredients.remove(ingredient);
	}
	*/
	
	/**
	 * @param list
	 */
	public void setIngredients(ArrayList list) {
		ingredients = list;
	}
	
	/**
	 * 
	 *
	public String toString() {
		String list = "";
        Ingredient ing;
		for(Iterator it=ingredients.iterator();it.hasNext();) {
            list+="\n"+(Ingredient)it.next();
        }			
		return list;
	} */

}
